<?php

namespace App\Repositories\Transformers;

use App\Models\CulturalHeritage;
use League\Fractal\TransformerAbstract;

class CulturalHeritageListTransformer extends TransformerAbstract
{
    public function transform(CulturalHeritage $culturalHeritage)
    {
        return [
            'id' => $culturalHeritage->id,
            'title' => $culturalHeritage->title,
            'desc' => $culturalHeritage->desc,
            'image' => $culturalHeritage->image,
            // 'content' => $culturalHeritage->content,
            'type' => $culturalHeritage->type,
            'created_at' => $culturalHeritage->created_at != null ? $culturalHeritage->created_at->toDateTimeString() : null,
        ];
    }
}
